# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=ipba2
pkgver=95.c03bd85
pkgrel=4
epoch=1
groups=('blackarch' 'blackarch-forensic')
pkgdesc='IOS Backup Analyzer.'
url='http://www.ipbackupanalyzer.com/'
arch=('any')
license=('GPL2')
depends=('python2' 'python2-pillow6' 'python2-pyside' 'python2-six' 'qt4')
makedepends=('git')
#source=("http://www.ipbackupanalyzer.com/downloads/python-pre-assembled-files/python-pre-assembled-files-$pkgver/ipba2-python-build-$pkgver-zip")
source=("$pkgname::git+https://github.com/PicciMario/iPhone-Backup-Analyzer-2.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin/"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -a * "$pkgdir/usr/share/$pkgname/"

cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec python2 /usr/share/$pkgname/main.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

